package pojo;

import Item_cart_li.ItemsWindow;

import javax.swing.*;
import java.awt.*;
import java.util.Objects;

public class Businessman {
    private String name;
    private Image imageIcon;
    private String[] Item;
    private double[] ItemPrice;

    public double[] getItemPrice() {
        return ItemPrice;
    }

    public void setItemPrice(double[] itemPrice) {
        ItemPrice = itemPrice;
    }

    public Image getImageIcon() {
        return imageIcon;
    }

    public void setImageIcon(Image imageIcon) {
        this.imageIcon = imageIcon;
    }

    public String[] getItem() {
        return Item;
    }

    public void setItem(String[] item) {
        Item = item;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Businessman(int id) {
        if(id==0){
            this.name = "塔斯汀";
            this.imageIcon = new ImageIcon(Objects.requireNonNull(ItemsWindow.class.getResource("/images/tasiting.jpg"))).getImage();
            this.Item = new String[]{"套餐1","套餐2","套餐3","套餐4","套餐5","套餐6","套餐7","套餐8"};
            this.ItemPrice = new double[]{10,20,10,20,10,20,10,20};
        }else if(id==1){
            this.name = "鲍汁黄焖鸡";
            this.imageIcon = new ImageIcon(Objects.requireNonNull(ItemsWindow.class.getResource("/images/huangmenji.jpg"))).getImage();
            this.Item = new String[]{"套餐1","套餐2","套餐3","套餐4","套餐5","套餐6","套餐7","套餐8"};
            this.ItemPrice = new double[]{1,2,3,4,5,6,7,8,9,10};
        }else if(id==2){
            this.name = "烧腊饭";
            this.imageIcon = new ImageIcon(Objects.requireNonNull(ItemsWindow.class.getResource("/images/th.jpg"))).getImage();
            this.Item = new String[]{"饭1","饭2","饭3","饭4","饭5","饭6","饭7","饭8",};
            this.ItemPrice = new double[]{1,2,3,4,5,6,7,8,9,10};
        }else if(id==3) {
            this.name = "茶颜悦色";
            this.imageIcon = new ImageIcon(Objects.requireNonNull(ItemsWindow.class.getResource("/images/chayanyuese.jpg"))).getImage();
            this.Item = new String[]{"饮料1","饮料2","饮料3","饮料1","饮料5","饮料6","饮料7","饮料8"};
            this.ItemPrice = new double[]{1,2,3,4,5,6,7,8,9,10};
        }
    }

//    public static void main(String[] args) {
//        Businessman businessman = new Businessman(0);
//
//        JFrame frame = new JFrame();
//        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        JPanel panel = new JPanel();
//        frame.add(panel);
//        JLabel label = new JLabel();
//        label.setIcon(new ImageIcon(businessman.getImageIcon()));
//        panel.add(label);
//
//        frame.setVisible(true);
//    }
}
